package be.rivendale.renderer.mk2.data;

import be.rivendale.geometry.Camera;
import be.rivendale.geometry.RawFileLoader;
import be.rivendale.geometry.TriangleModel;
import be.rivendale.material.Color;
import be.rivendale.mathematics.Triple;
import be.rivendale.mathematics.Vertex;

import java.net.MalformedURLException;
import java.net.URL;

public class Scene {
    private Vertex light = new Vertex(0, 0, -5, Color.WHITE);
    private Camera camera = new Camera(new Triple(0, 0, -5), 5, 1);
//    private Camera camera = new Camera();
//    private TriangleModel model = RawFileLoader.loadRawFile("./data/multiple.raw.txt", new Triple(0, 0, 10));
//    private TriangleModel model = RawFileLoader.loadRawFile("./data/asteroid-lowres.raw.txt", new Triple(0, 0, 10));
//    private TriangleModel model = RawFileLoader.loadRawFile("./data/torus.raw.txt", new Triple(0, 0, 10));
//    private TriangleModel model = RawFileLoader.loadRawFile("./data/sphere.raw.txt", new Triple(0, 0, 10));
    private TriangleModel model;


    public Scene() {
        try {
            model = RawFileLoader.loadRawFileByUrl(new URL("http://users.telenet.be/kevinvr/scenes/sphere.raw.txt"), new Triple(0, 0, 10));
        } catch (MalformedURLException exception) {
            throw new RuntimeException(exception);
        }
    }

    public TriangleModel getModel() {
        return model;
    }

    public Camera getCamera() {
        return camera;
    }

    public Vertex getLight() {
        return light;
    }
}
